<?php

// called from index function of main_interface.php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
echo "</br>Mail_reading_view</br>";

$whichfamily = $_SESSION['active_family'];
$family = $this->doctrine->em->find('ORM\Dynasties2\Families', $whichfamily);
echo "You are logged in as the <b>" . $family->getFamilyName() . "</b> family.</br></br>";

$current_turn = '1';

//print_r($maildata);
// \Doctrine\Common\Util\Debug::dump($maildata);
echo "</br></br>";

echo "Messages follow: </br>";
foreach ($maildata as $key => $row) {



echo "</br></br>";

	
    
        
    //echo ($row->getName()) . ($row->getId());
    $message_text = $row -> getMsgId() -> getMsgText();
    $from_user_id = $row -> getMsgId() -> getFromUser();
    //$time_stamp = $row-> getMsgId() -> getTimeStamp();
    $time_stamp = $row->getMsgId()->getTimeStamp()->format('Y-m-d H:i:s');
    
    $importance = $row -> getMsgId() -> getImportance();
    $msg_type = $row -> getMsgId() -> getMsgType();
    
    //var_dump(get_object_vars($row-> getMsgId() -> getTimeStamp()));
    //var_dump(get_object_vars($ts));
    
    
    
    echo $message_text;
    echo "</br>     From user# " . $from_user_id . ", ";
    echo "with timestamp " . $time_stamp . ", ";
    echo "importance of " . $importance . ", and type is " . $msg_type . ".</br>";
    echo " ---------------------";
    echo "</br>";
         
         
}


